"""xm URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path

from web.views import user
from web.views import level
from web.views import policy
from web.views import account
from web.views import my_order
from web.views import transaction

urlpatterns = [
    # 已在settings中配置，故注释掉
    # path('admin/', admin.site.urls), LookupError: No installed app with label 'admin'.
    path('login/', account.login, name='login'),
    path('logout/', account.logout, name='logout'),
    path('sms_login/', account.sms_login, name='sms_login'),
    path('sms_send/', account.sms_send, name='sms_send'),
    path('home/', account.home, name='home'),
    # path('level/',account.level, name='level'),
    path('level/list', level.level_list, name='level_list'),
    path('level/add', level.level_add, name='level_add'),
    path('level/edit/<int:pk>', level.level_edit, name='level_edit'),
    path('level/delete/<int:pk>', level.level_delete, name='level_delete'),
    path('user/list', user.user_list, name='user_list'),
    path('user/add', user.user_add, name='user_add'),
    path('user/charge/<int:pk>', user.user_charge, name='user_charge'),
    path('user/charge/<int:pk>/add', user.user_charge_add, name='user_charge_add'),
    path('user/reset/<int:pk>', user.user_reset, name='user_reset'),
    path('user/edit/<int:pk>', user.user_edit, name='user_edit'),
    path('user/delete', user.user_delete, name='user_delete'),

    path('policy/list', policy.policy_list, name='policy_list'),
    path('policy/add', policy.policy_add, name='policy_add'),
    path('policy/edit/<int:pk>', policy.policy_edit, name='policy_edit'),
    path('policy/delete', policy.policy_delete, name='policy_delete'),
    path('my_order/list', my_order.my_order_list, name='my_order_list'),
    path('my_order/list/add', my_order.my_order_list_add, name='my_order_list_add'),
    path('my_order/list/cancel/<int:pk>', my_order.my_order_list_cancel, name='my_order_list_cancel'),
    path('my_transaction/list', transaction.my_transaction_list, name='my_transaction_list'),
    path('transaction/list', transaction.transaction_list, name='transaction_list'),


]
